import * as proxy from '../proxy';
import ServiceBase from '../base';

const GET_PROJECT = '/accounts';
const GET_RECYCLE = '/recyclebin';

class RecycleService extends ServiceBase {
    getProjectRecycle = (data) => {
        let promise = super.get({
            url: GET_PROJECT + `/${data.accountId}/projects/${data.projectId}` + GET_RECYCLE,
        });
        return proxy.httpResultProxy(promise);
    };
    recoverProjectRecycle = (data) => {
        let promise = super.post({
            url: GET_PROJECT + `/${data.accountId}/projects/${data.projectId}` + GET_RECYCLE + `/${data.id}`,
        });
        return proxy.httpResultProxy(promise);
    };
    deleteProjectRecycle = (data) => {
        let promise = super.delete({
            url: GET_PROJECT + `/${data.accountId}/projects/${data.projectId}/${GET_RECYCLE}`,
            data: data.data,
        });
        return proxy.httpResultProxy(promise);
    };
}

export {RecycleService};
